package com.zqs.sso.controller;

public class Response {
    public static final int SUCCESS_CODE = 200;
    public static final int ERROR_CODE = 500;

    private final int code;
    private final String message;
    private final Object data;

    public Response(int code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public Object getData() {
        return data;
    }

    public static Response success(Object data) {
        return new Response(SUCCESS_CODE, "success", data);
    }

    public static Response error(String message) {
        return new Response(ERROR_CODE, message, "");
    }
}